Inference center correction#19
Merged
sfarrens merged 3 commits intoCosmoStat:mainfrom May 6, 2026
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
…d) due to compatibility issues with the ArviZ library
Member
|
Have you tested that everything works if you change the image sizes and, importantly, change from an even number to and odd number of pixels? |
Contributor
Author
I tried 49x49, 48x48, 25x25 and 64x64, by selecting the x_min/x_max and y_min/y_max values that allow for accurate inference each time, the results are no longer biased. |
sfarrens
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Removed the offset from scene.py::build_batched_model on x and y (+0.5) which would result in a discrepancy between the inferred position of the galaxy's center and the observed position
Added a unit test (test_centers_match) to verify that the positions of the centers of the observed and inferred galaxies are the same in test_btached_inference::TestBuildBatchedModel. This test reuses the configuration used in lvl0 and runs a short inference to verify that the centers of the observations and the centers recorded during inference are the same
Test workflows have been restricted to Python 3.11 (3.12 and 3.13 have been removed) due to compatibility issues with the Arviz library : """ FAILED tests/test_validation/test_extraction.py::TestExtractConvergenceDiagnostics::test_rhat_near_one - TypeError: from_dict() got an unexpected keyword argument 'posterior'
""" This new library version can only be installed on Python 3.12 or later
Migration guide : https://python.arviz.org/en/latest/user_guide/migration_guide.html